package operator.create;

import io.reactivex.Observable;
import io.reactivex.schedulers.Schedulers;
import util.RxJavaHelper;
import util.ThreadHelper;

class RangeOperator {

    public static void main(String[] args) {
        range();
//        rangeLong();
    }

    static void range(){
        //发射一个范围内的有序整数序列，默认是当前线程
        Observable.range(1,5)
                .subscribeOn(Schedulers.io())
                .subscribe(RxJavaHelper.getConsumer());
        ThreadHelper.sleep();
    }

    static void rangeLong(){
        //发射一个范围内的有序整数序列，默认是当前线程
        Observable.rangeLong(1,10)
//                .observeOn(Schedulers.io())
                .subscribe(RxJavaHelper.getConsumer());
//        ThreadHelper.sleep();
    }



}
